//
//  ImageListViewController.m
//  MyCloud
//
//  Created by Visitor on 7/15/13.
//  Copyright (c) 2013 visitor.zc@gmail.com. All rights reserved.
//

#import "ImageListViewController.h"

@interface ImageListViewController ()

@end

@implementation ImageListViewController
{
    MyImage *_myImage;
    NSMutableArray *_imageList;
}

- (void)dealloc
{
    [_imageList release];
    [super dealloc];
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor redColor];
    
    _imageList = [[NSMutableArray alloc] init];
    
    self.navigationController.view.frame = CGRectMake(0, -44, 320, 480+44);
    MyBackBar *myBackBar = [[MyBackBar alloc] initWithTitle:@"照片" andType:2];
    myBackBar.delegate = self;
    myBackBar.frame = CGRectMake(0, 44, 320, 44);
    [self.view addSubview:myBackBar];
    [myBackBar release];

    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"wifi.png"]];
    imageView.frame = CGRectMake(0, 88, 320, 480-44);
    [self.view addSubview:imageView];
    [imageView release];
    
    
    _myImage = [MyImage sharedMyImage];
    _myImage.delegate = self;
    // 得到组信息和图片信息
    [_myImage getImageList];
}

- (void)getImageListFinish:(NSMutableArray *)imageList
{
    NSLog(@"imageList = %@",imageList);
    _imageList = imageList;
    for(NSString *str in _imageList)
    {
        [_myImage getImageWithStr:str];
    }
}


- (void)getImageGroupFinish:(NSMutableString *)imageGroup
{
    NSLog(@"imagrGroup = %@",imageGroup);
}

- (void)getImageFinish:(UIImage *)image
{    
    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
    imageView.frame = CGRectMake(0, 88, 320, 480-44);
    [self.view addSubview:imageView];
    [imageView release];
}

- (void)backImageClick
{
    self.navigationController.view.frame = CGRectMake(0, 0, 320, 480);
    [self.navigationController popViewControllerAnimated:YES];
}



- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
